function timeout() {
  return new Promise(resolve => {
    setTimeout(resolve, ms)
  })
}

async function asyncPrint(value, ms) {
  await timeout(ms)
  console.log(value);
}

asyncPrint('hello world', 500)
